unit Class_WAGE_FL_OLD;


interface
uses
  Classes,SysUtils,DB,Uni,UniEngine;

type
  TWAGEFLOLD=class(TUniEngine)
  private
    FUNITLINK : string;
    FGZJGIDEX : Integer;
    FWAGEKJND : Integer;
    FWAGEKJQJ : Integer;
    FWAGEIDEX : Integer;
    FSTAFIDEX : Integer;
    FSTAFBDID : Integer;
    FSTAFTYPE : Integer;
    FSTAFBANK : string;
    FSTAFNUMB : string;
    FWAGEGSND : Integer;
    FWAGEGSQJ : Integer;
    FGSNDGSQJ : Integer;
    FKJNDKJQJ : Integer;
    FHOLDTYPE : Integer;
    FISDEALED : Integer;
    FHOLDFROM : Integer;
    FISHOLDED : Integer;
    FFIELD1   : string;
    FFIELD2   : string;
    FFIELD3   : string;
    FFIELD4   : string;
    FFIELD5   : string;
    FFIELD6   : string;
    FFIELD7   : string;
    FFIELD8   : string;
    FFIELD9   : string;
    FFIELD10  : string;
    FFIELD11  : string;
    FFIELD12  : string;
    FFIELD13  : string;
    FFIELD14  : string;
    FFIELD15  : string;
    FFIELD16  : string;
    FFIELD17  : string;
    FFIELD18  : string;
    FFIELD19  : string;
    FFIELD20  : string;
    FFIELD21  : string;
    FMEMO1    : string;
    FFIELD22  : string;
    FFIELD23  : string;
    FFIELD24  : string;
    FFIELD25  : string;
    FFIELD26  : string;
    FFIELD27  : string;
    FFIELD28  : string;
    FFIELD29  : string;
    FFIELD30  : string;
    FFIELD31  : string;
    FUNITFROM : string;
  protected
    procedure SetParameters;override;
    function  GetStrInsert:string;override;
    function  GetStrUpdate:string;override;
    function  GetStrDelete:string;override;
  public
    function  GetStrsIndex:string;override;
  public
    function  GetNextIdex:Integer;overload;
    function  GetNextIdex(AUniConnection:TUniConnection):Integer;overload;
  public
    function  CheckExist(AUniConnection:TUniConnection):Boolean;override;
  public
    destructor  Destroy; override;
    constructor Create;
  published
    property UNITLINK : string read FUNITLINK  write FUNITLINK;
    property GZJGIDEX : Integer read FGZJGIDEX  write FGZJGIDEX;
    property WAGEKJND : Integer read FWAGEKJND  write FWAGEKJND;
    property WAGEKJQJ : Integer read FWAGEKJQJ  write FWAGEKJQJ;
    property WAGEIDEX : Integer read FWAGEIDEX  write FWAGEIDEX;
    property STAFIDEX : Integer read FSTAFIDEX  write FSTAFIDEX;
    property STAFBDID : Integer read FSTAFBDID  write FSTAFBDID;
    property STAFTYPE : Integer read FSTAFTYPE  write FSTAFTYPE;
    property STAFBANK : string read FSTAFBANK  write FSTAFBANK;
    property STAFNUMB : string read FSTAFNUMB  write FSTAFNUMB;
    property WAGEGSND : Integer read FWAGEGSND  write FWAGEGSND;
    property WAGEGSQJ : Integer read FWAGEGSQJ  write FWAGEGSQJ;
    property GSNDGSQJ : Integer read FGSNDGSQJ  write FGSNDGSQJ;
    property KJNDKJQJ : Integer read FKJNDKJQJ  write FKJNDKJQJ;
    property HOLDTYPE : Integer read FHOLDTYPE  write FHOLDTYPE;
    property ISDEALED : Integer read FISDEALED  write FISDEALED;
    property HOLDFROM : Integer read FHOLDFROM  write FHOLDFROM;
    property ISHOLDED : Integer read FISHOLDED  write FISHOLDED;
    property FIELD1   : string read FFIELD1    write FFIELD1;
    property FIELD2   : string read FFIELD2    write FFIELD2;
    property FIELD3   : string read FFIELD3    write FFIELD3;
    property FIELD4   : string read FFIELD4    write FFIELD4;
    property FIELD5   : string read FFIELD5    write FFIELD5;
    property FIELD6   : string read FFIELD6    write FFIELD6;
    property FIELD7   : string read FFIELD7    write FFIELD7;
    property FIELD8   : string read FFIELD8    write FFIELD8;
    property FIELD9   : string read FFIELD9    write FFIELD9;
    property FIELD10  : string read FFIELD10   write FFIELD10;
    property FIELD11  : string read FFIELD11   write FFIELD11;
    property FIELD12  : string read FFIELD12   write FFIELD12;
    property FIELD13  : string read FFIELD13   write FFIELD13;
    property FIELD14  : string read FFIELD14   write FFIELD14;
    property FIELD15  : string read FFIELD15   write FFIELD15;
    property FIELD16  : string read FFIELD16   write FFIELD16;
    property FIELD17  : string read FFIELD17   write FFIELD17;
    property FIELD18  : string read FFIELD18   write FFIELD18;
    property FIELD19  : string read FFIELD19   write FFIELD19;
    property FIELD20  : string read FFIELD20   write FFIELD20;
    property FIELD21  : string read FFIELD21   write FFIELD21;
    property MEMO1    : string read FMEMO1     write FMEMO1;
    property FIELD22  : string read FFIELD22   write FFIELD22;
    property FIELD23  : string read FFIELD23   write FFIELD23;
    property FIELD24  : string read FFIELD24   write FFIELD24;
    property FIELD25  : string read FFIELD25   write FFIELD25;
    property FIELD26  : string read FFIELD26   write FFIELD26;
    property FIELD27  : string read FFIELD27   write FFIELD27;
    property FIELD28  : string read FFIELD28   write FFIELD28;
    property FIELD29  : string read FFIELD29   write FFIELD29;
    property FIELD30  : string read FFIELD30   write FFIELD30;
    property FIELD31  : string read FFIELD31   write FFIELD31;
    property UNITFROM : string read FUNITFROM  write FUNITFROM;
  public
    class function  ReadDS(AUniQuery:TUniQuery):TUniEngine;override;
    class procedure ReadDS(AUniQuery:TUniQuery;var Result:TUniEngine);override;
    class function  CopyIt(AWAGEFL:TWAGEFLOLD):TWAGEFLOLD;overload;
    class procedure CopyIt(AWAGEFL:TWAGEFLOLD;var Result:TWAGEFLOLD);overload;
  end;

implementation

{ TWAGEFLOLD }
procedure TWAGEFLOLD.SetParameters;
begin
  inherited;
  with FUniSQL.Params do
  begin
    case FOptTyp of
      otAddx:
      begin
        ParamByName('UNIT_LINK').Value := UNITLINK;
        ParamByName('GZJG_IDEX').Value := GZJGIDEX;
        ParamByName('WAGE_KJND').Value := WAGEKJND;
        ParamByName('WAGE_KJQJ').Value := WAGEKJQJ;
        ParamByName('WAGE_IDEX').Value := WAGEIDEX;
        ParamByName('STAF_IDEX').Value := STAFIDEX;
        ParamByName('STAF_BDID').Value := STAFBDID;
        ParamByName('STAF_TYPE').Value := STAFTYPE;
        ParamByName('STAF_BANK').Value := STAFBANK;
        ParamByName('STAF_NUMB').Value := STAFNUMB;
        ParamByName('WAGE_GSND').Value := WAGEGSND;
        ParamByName('WAGE_GSQJ').Value := WAGEGSQJ;
        ParamByName('GSND_GSQJ').Value := GSNDGSQJ;
        ParamByName('KJND_KJQJ').Value := KJNDKJQJ;
        ParamByName('HOLD_TYPE').Value := HOLDTYPE;
        ParamByName('IS_DEALED').Value := ISDEALED;
        ParamByName('HOLD_FROM').Value := HOLDFROM;
        ParamByName('IS_HOLDED').Value := ISHOLDED;
        ParamByName('FIELD1').Value := FIELD1;
        ParamByName('FIELD2').Value := FIELD2;
        ParamByName('FIELD3').Value := FIELD3;
        ParamByName('FIELD4').Value := FIELD4;
        ParamByName('FIELD5').Value := FIELD5;
        ParamByName('FIELD6').Value := FIELD6;
        ParamByName('FIELD7').Value := FIELD7;
        ParamByName('FIELD8').Value := FIELD8;
        ParamByName('FIELD9').Value := FIELD9;
        ParamByName('FIELD10').Value := FIELD10;
        ParamByName('FIELD11').Value := FIELD11;
        ParamByName('FIELD12').Value := FIELD12;
        ParamByName('FIELD13').Value := FIELD13;
        ParamByName('FIELD14').Value := FIELD14;
        ParamByName('FIELD15').Value := FIELD15;
        ParamByName('FIELD16').Value := FIELD16;
        ParamByName('FIELD17').Value := FIELD17;
        ParamByName('FIELD18').Value := FIELD18;
        ParamByName('FIELD19').Value := FIELD19;
        ParamByName('FIELD20').Value := FIELD20;
        ParamByName('FIELD21').Value := FIELD21;
        ParamByName('MEMO1').Value := MEMO1;
        ParamByName('FIELD22').Value := FIELD22;
        ParamByName('FIELD23').Value := FIELD23;
        ParamByName('FIELD24').Value := FIELD24;
        ParamByName('FIELD25').Value := FIELD25;
        ParamByName('FIELD26').Value := FIELD26;
        ParamByName('FIELD27').Value := FIELD27;
        ParamByName('FIELD28').Value := FIELD28;
        ParamByName('FIELD29').Value := FIELD29;
        ParamByName('FIELD30').Value := FIELD30;
        ParamByName('FIELD31').Value := FIELD31;
        ParamByName('UNIT_FROM').Value := UNITFROM;
      end;
      otEdit:
      begin
        ParamByName('UNIT_LINK').Value := UNITLINK;
        ParamByName('GZJG_IDEX').Value := GZJGIDEX;
        ParamByName('WAGE_KJND').Value := WAGEKJND;
        ParamByName('WAGE_KJQJ').Value := WAGEKJQJ;
        ParamByName('WAGE_IDEX').Value := WAGEIDEX;
        ParamByName('STAF_IDEX').Value := STAFIDEX;
        ParamByName('STAF_BDID').Value := STAFBDID;
        ParamByName('STAF_TYPE').Value := STAFTYPE;
        ParamByName('STAF_BANK').Value := STAFBANK;
        ParamByName('STAF_NUMB').Value := STAFNUMB;
        ParamByName('WAGE_GSND').Value := WAGEGSND;
        ParamByName('WAGE_GSQJ').Value := WAGEGSQJ;
        ParamByName('GSND_GSQJ').Value := GSNDGSQJ;
        ParamByName('KJND_KJQJ').Value := KJNDKJQJ;
        ParamByName('HOLD_TYPE').Value := HOLDTYPE;
        ParamByName('IS_DEALED').Value := ISDEALED;
        ParamByName('HOLD_FROM').Value := HOLDFROM;
        ParamByName('IS_HOLDED').Value := ISHOLDED;
        ParamByName('FIELD1').Value := FIELD1;
        ParamByName('FIELD2').Value := FIELD2;
        ParamByName('FIELD3').Value := FIELD3;
        ParamByName('FIELD4').Value := FIELD4;
        ParamByName('FIELD5').Value := FIELD5;
        ParamByName('FIELD6').Value := FIELD6;
        ParamByName('FIELD7').Value := FIELD7;
        ParamByName('FIELD8').Value := FIELD8;
        ParamByName('FIELD9').Value := FIELD9;
        ParamByName('FIELD10').Value := FIELD10;
        ParamByName('FIELD11').Value := FIELD11;
        ParamByName('FIELD12').Value := FIELD12;
        ParamByName('FIELD13').Value := FIELD13;
        ParamByName('FIELD14').Value := FIELD14;
        ParamByName('FIELD15').Value := FIELD15;
        ParamByName('FIELD16').Value := FIELD16;
        ParamByName('FIELD17').Value := FIELD17;
        ParamByName('FIELD18').Value := FIELD18;
        ParamByName('FIELD19').Value := FIELD19;
        ParamByName('FIELD20').Value := FIELD20;
        ParamByName('FIELD21').Value := FIELD21;
        ParamByName('MEMO1').Value := MEMO1;
        ParamByName('FIELD22').Value := FIELD22;
        ParamByName('FIELD23').Value := FIELD23;
        ParamByName('FIELD24').Value := FIELD24;
        ParamByName('FIELD25').Value := FIELD25;
        ParamByName('FIELD26').Value := FIELD26;
        ParamByName('FIELD27').Value := FIELD27;
        ParamByName('FIELD28').Value := FIELD28;
        ParamByName('FIELD29').Value := FIELD29;
        ParamByName('FIELD30').Value := FIELD30;
        ParamByName('FIELD31').Value := FIELD31;
        ParamByName('UNIT_FROM').Value := UNITFROM;
      end;
      otDelt:
      begin
        ParamByName('UNIT_LINK').Value := UNITLINK;
        ParamByName('GZJG_IDEX').Value := GZJGIDEX;
        ParamByName('WAGE_KJND').Value := WAGEKJND;
        ParamByName('WAGE_KJQJ').Value := WAGEKJQJ;
        ParamByName('WAGE_IDEX').Value := WAGEIDEX;
        ParamByName('STAF_IDEX').Value := STAFIDEX;
        ParamByName('HOLD_TYPE').Value := HOLDTYPE;
        ParamByName('HOLD_FROM').Value := HOLDFROM;
        ParamByName('UNIT_FROM').Value := UNITFROM;
      end;
    end;
  end;
end;

function TWAGEFLOLD.CheckExist(AUniConnection: TUniConnection): Boolean;
begin
  Result:=CheckExist('TBL_WAGE_FL',['UNIT_LINK',UNITLINK,'GZJG_IDEX',GZJGIDEX,'WAGE_KJND',WAGEKJND,'WAGE_KJQJ',WAGEKJQJ,'WAGE_IDEX',WAGEIDEX,'STAF_IDEX',STAFIDEX,'HOLD_TYPE',HOLDTYPE,'HOLD_FROM',HOLDFROM,'UNIT_FROM',UNITFROM],AUniConnection);
end;

function TWAGEFLOLD.GetNextIdex: Integer;
begin

end;

function TWAGEFLOLD.GetNextIdex(AUniConnection: TUniConnection): Integer;
begin

end;

function TWAGEFLOLD.GetStrDelete: string;
begin
  Result:='DELETE FROM TBL_WAGE_FL WHERE   UNIT_LINK=:UNIT_LINK AND GZJG_IDEX=:GZJG_IDEX AND WAGE_KJND=:WAGE_KJND AND WAGE_KJQJ=:WAGE_KJQJ AND WAGE_IDEX=:WAGE_IDEX AND STAF_IDEX=:STAF_IDEX AND HOLD_TYPE=:HOLD_TYPE AND HOLD_FROM=:HOLD_FROM AND UNIT_FROM=:UNIT_FROM';
end;

function TWAGEFLOLD.GetStrInsert: string;
begin
  Result:='INSERT INTO TBL_WAGE_FL'
         +'    ( UNIT_LINK, GZJG_IDEX, WAGE_KJND, WAGE_KJQJ, WAGE_IDEX'
         +'    , STAF_IDEX, STAF_BDID, STAF_TYPE, STAF_BANK, STAF_NUMB'
         +'    , WAGE_GSND, WAGE_GSQJ, GSND_GSQJ, KJND_KJQJ, HOLD_TYPE'
         +'    , IS_DEALED, HOLD_FROM, IS_HOLDED, FIELD1, FIELD2, FIELD3'
         +'    , FIELD4, FIELD5, FIELD6, FIELD7, FIELD8, FIELD9, FIELD10'
         +'    , FIELD11, FIELD12, FIELD13, FIELD14, FIELD15, FIELD16'
         +'    , FIELD17, FIELD18, FIELD19, FIELD20, FIELD21, MEMO1'
         +'    , FIELD22, FIELD23, FIELD24, FIELD25, FIELD26, FIELD27'
         +'    , FIELD28, FIELD29, FIELD30, FIELD31, UNIT_FROM)'
         +'    VALUES'
         +'    (:UNIT_LINK,:GZJG_IDEX,:WAGE_KJND,:WAGE_KJQJ,:WAGE_IDEX'
         +'    ,:STAF_IDEX,:STAF_BDID,:STAF_TYPE,:STAF_BANK,:STAF_NUMB'
         +'    ,:WAGE_GSND,:WAGE_GSQJ,:GSND_GSQJ,:KJND_KJQJ,:HOLD_TYPE'
         +'    ,:IS_DEALED,:HOLD_FROM,:IS_HOLDED,:FIELD1,:FIELD2,:FIELD3'
         +'    ,:FIELD4,:FIELD5,:FIELD6,:FIELD7,:FIELD8,:FIELD9,:FIELD10'
         +'    ,:FIELD11,:FIELD12,:FIELD13,:FIELD14,:FIELD15,:FIELD16'
         +'    ,:FIELD17,:FIELD18,:FIELD19,:FIELD20,:FIELD21,:MEMO1'
         +'    ,:FIELD22,:FIELD23,:FIELD24,:FIELD25,:FIELD26,:FIELD27'
         +'    ,:FIELD28,:FIELD29,:FIELD30,:FIELD31,:UNIT_FROM)';
end;

function TWAGEFLOLD.GetStrsIndex: string;
begin
  Result:=Format('%S-%D-%D-%D-%D-%D-%D-%D-%S',[UNITLINK,GZJGIDEX,WAGEKJND,WAGEKJQJ,WAGEIDEX,STAFIDEX,HOLDTYPE,HOLDFROM,UNITFROM]);
end;

function TWAGEFLOLD.GetStrUpdate: string;
begin
  Result:='UPDATE  TBL_WAGE_FL SET'
         +'    STAF_BDID=:STAF_BDID,'
         +'    STAF_TYPE=:STAF_TYPE,'
         +'    STAF_BANK=:STAF_BANK,'
         +'    STAF_NUMB=:STAF_NUMB,'
         +'    WAGE_GSND=:WAGE_GSND,'
         +'    WAGE_GSQJ=:WAGE_GSQJ,'
         +'    GSND_GSQJ=:GSND_GSQJ,'
         +'    KJND_KJQJ=:KJND_KJQJ,'
         +'    IS_DEALED=:IS_DEALED,'
         +'    IS_HOLDED=:IS_HOLDED,'
         +'    FIELD1=:FIELD1,'
         +'    FIELD2=:FIELD2,'
         +'    FIELD3=:FIELD3,'
         +'    FIELD4=:FIELD4,'
         +'    FIELD5=:FIELD5,'
         +'    FIELD6=:FIELD6,'
         +'    FIELD7=:FIELD7,'
         +'    FIELD8=:FIELD8,'
         +'    FIELD9=:FIELD9,'
         +'    FIELD10=:FIELD10,'
         +'    FIELD11=:FIELD11,'
         +'    FIELD12=:FIELD12,'
         +'    FIELD13=:FIELD13,'
         +'    FIELD14=:FIELD14,'
         +'    FIELD15=:FIELD15,'
         +'    FIELD16=:FIELD16,'
         +'    FIELD17=:FIELD17,'
         +'    FIELD18=:FIELD18,'
         +'    FIELD19=:FIELD19,'
         +'    FIELD20=:FIELD20,'
         +'    FIELD21=:FIELD21,'
         +'    MEMO1=:MEMO1,'
         +'    FIELD22=:FIELD22,'
         +'    FIELD23=:FIELD23,'
         +'    FIELD24=:FIELD24,'
         +'    FIELD25=:FIELD25,'
         +'    FIELD26=:FIELD26,'
         +'    FIELD27=:FIELD27,'
         +'    FIELD28=:FIELD28,'
         +'    FIELD29=:FIELD29,'
         +'    FIELD30=:FIELD30,'
         +'    FIELD31=:FIELD31'
         +'    WHERE UNIT_LINK=:UNIT_LINK'
         +'    AND   GZJG_IDEX=:GZJG_IDEX'
         +'    AND   WAGE_KJND=:WAGE_KJND'
         +'    AND   WAGE_KJQJ=:WAGE_KJQJ'
         +'    AND   WAGE_IDEX=:WAGE_IDEX'
         +'    AND   STAF_IDEX=:STAF_IDEX'
         +'    AND   HOLD_TYPE=:HOLD_TYPE'
         +'    AND   HOLD_FROM=:HOLD_FROM'
         +'    AND   UNIT_FROM=:UNIT_FROM';
end;

constructor TWAGEFLOLD.Create;
begin

end;

destructor TWAGEFLOLD.Destroy;
begin

  inherited;
end;

class function TWAGEFLOLD.ReadDS(AUniQuery: TUniQuery): TUniEngine;
var
  I:Integer;
  Field:TField;
  FieldName:string;
begin
  Result:=TWAGEFLOLD.Create;

  with TWAGEFLOLD(Result) do
  begin
    for I:=0 to AUniQuery.Fields.Count-1 do
    begin
      Field:=AUniQuery.Fields.Fields[I];
      //if field.fieldname is not all uppercase,please use uppercase().
      FieldName:=Field.FieldName;
      if FieldName='UNIT_LINK' then
      begin
        UNITLINK :=Field.AsString;
      end else
      if FieldName='GZJG_IDEX' then
      begin
        GZJGIDEX :=Field.AsInteger;
      end else
      if FieldName='WAGE_KJND' then
      begin
        WAGEKJND :=Field.AsInteger;
      end else
      if FieldName='WAGE_KJQJ' then
      begin
        WAGEKJQJ :=Field.AsInteger;
      end else
      if FieldName='WAGE_IDEX' then
      begin
        WAGEIDEX :=Field.AsInteger;
      end else
      if FieldName='STAF_IDEX' then
      begin
        STAFIDEX :=Field.AsInteger;
      end else
      if FieldName='STAF_BDID' then
      begin
        STAFBDID :=Field.AsInteger;
      end else
      if FieldName='STAF_TYPE' then
      begin
        STAFTYPE :=Field.AsInteger;
      end else
      if FieldName='STAF_BANK' then
      begin
        STAFBANK :=Field.AsString;
      end else
      if FieldName='STAF_NUMB' then
      begin
        STAFNUMB :=Field.AsString;
      end else
      if FieldName='WAGE_GSND' then
      begin
        WAGEGSND :=Field.AsInteger;
      end else
      if FieldName='WAGE_GSQJ' then
      begin
        WAGEGSQJ :=Field.AsInteger;
      end else
      if FieldName='GSND_GSQJ' then
      begin
        GSNDGSQJ :=Field.AsInteger;
      end else
      if FieldName='KJND_KJQJ' then
      begin
        KJNDKJQJ :=Field.AsInteger;
      end else
      if FieldName='HOLD_TYPE' then
      begin
        HOLDTYPE :=Field.AsInteger;
      end else
      if FieldName='IS_DEALED' then
      begin
        ISDEALED :=Field.AsInteger;
      end else
      if FieldName='HOLD_FROM' then
      begin
        HOLDFROM :=Field.AsInteger;
      end else
      if FieldName='IS_HOLDED' then
      begin
        ISHOLDED :=Field.AsInteger;
      end else
      if FieldName='FIELD1' then
      begin
        FIELD1   :=Field.AsString;
      end else
      if FieldName='FIELD2' then
      begin
        FIELD2   :=Field.AsString;
      end else
      if FieldName='FIELD3' then
      begin
        FIELD3   :=Field.AsString;
      end else
      if FieldName='FIELD4' then
      begin
        FIELD4   :=Field.AsString;
      end else
      if FieldName='FIELD5' then
      begin
        FIELD5   :=Field.AsString;
      end else
      if FieldName='FIELD6' then
      begin
        FIELD6   :=Field.AsString;
      end else
      if FieldName='FIELD7' then
      begin
        FIELD7   :=Field.AsString;
      end else
      if FieldName='FIELD8' then
      begin
        FIELD8   :=Field.AsString;
      end else
      if FieldName='FIELD9' then
      begin
        FIELD9   :=Field.AsString;
      end else
      if FieldName='FIELD10' then
      begin
        FIELD10  :=Field.AsString;
      end else
      if FieldName='FIELD11' then
      begin
        FIELD11  :=Field.AsString;
      end else
      if FieldName='FIELD12' then
      begin
        FIELD12  :=Field.AsString;
      end else
      if FieldName='FIELD13' then
      begin
        FIELD13  :=Field.AsString;
      end else
      if FieldName='FIELD14' then
      begin
        FIELD14  :=Field.AsString;
      end else
      if FieldName='FIELD15' then
      begin
        FIELD15  :=Field.AsString;
      end else
      if FieldName='FIELD16' then
      begin
        FIELD16  :=Field.AsString;
      end else
      if FieldName='FIELD17' then
      begin
        FIELD17  :=Field.AsString;
      end else
      if FieldName='FIELD18' then
      begin
        FIELD18  :=Field.AsString;
      end else
      if FieldName='FIELD19' then
      begin
        FIELD19  :=Field.AsString;
      end else
      if FieldName='FIELD20' then
      begin
        FIELD20  :=Field.AsString;
      end else
      if FieldName='FIELD21' then
      begin
        FIELD21  :=Field.AsString;
      end else
      if FieldName='MEMO1' then
      begin
        MEMO1    :=Field.AsString;
      end else
      if FieldName='FIELD22' then
      begin
        FIELD22  :=Field.AsString;
      end else
      if FieldName='FIELD23' then
      begin
        FIELD23  :=Field.AsString;
      end else
      if FieldName='FIELD24' then
      begin
        FIELD24  :=Field.AsString;
      end else
      if FieldName='FIELD25' then
      begin
        FIELD25  :=Field.AsString;
      end else
      if FieldName='FIELD26' then
      begin
        FIELD26  :=Field.AsString;
      end else
      if FieldName='FIELD27' then
      begin
        FIELD27  :=Field.AsString;
      end else
      if FieldName='FIELD28' then
      begin
        FIELD28  :=Field.AsString;
      end else
      if FieldName='FIELD29' then
      begin
        FIELD29  :=Field.AsString;
      end else
      if FieldName='FIELD30' then
      begin
        FIELD30  :=Field.AsString;
      end else
      if FieldName='FIELD31' then
      begin
        FIELD31  :=Field.AsString;
      end else
      if FieldName='UNIT_FROM' then
      begin
        UNITFROM :=Field.AsString;
      end;
    end
  end;
end;

class procedure TWAGEFLOLD.ReadDS(AUniQuery: TUniQuery; var Result: TUniEngine);
var
  I:Integer;
  Field:TField;
  FieldName:string;
begin
  if Result=nil then Exit;

  with TWAGEFLOLD(Result) do
  begin
    for I:=0 to AUniQuery.Fields.Count-1 do
    begin
      Field:=AUniQuery.Fields.Fields[I];
      //if field.fieldname is not all uppercase,please use uppercase().
      FieldName:=Field.FieldName;
      if FieldName='UNIT_LINK' then
      begin
        UNITLINK :=Field.AsString;
      end else
      if FieldName='GZJG_IDEX' then
      begin
        GZJGIDEX :=Field.AsInteger;
      end else
      if FieldName='WAGE_KJND' then
      begin
        WAGEKJND :=Field.AsInteger;
      end else
      if FieldName='WAGE_KJQJ' then
      begin
        WAGEKJQJ :=Field.AsInteger;
      end else
      if FieldName='WAGE_IDEX' then
      begin
        WAGEIDEX :=Field.AsInteger;
      end else
      if FieldName='STAF_IDEX' then
      begin
        STAFIDEX :=Field.AsInteger;
      end else
      if FieldName='STAF_BDID' then
      begin
        STAFBDID :=Field.AsInteger;
      end else
      if FieldName='STAF_TYPE' then
      begin
        STAFTYPE :=Field.AsInteger;
      end else
      if FieldName='STAF_BANK' then
      begin
        STAFBANK :=Field.AsString;
      end else
      if FieldName='STAF_NUMB' then
      begin
        STAFNUMB :=Field.AsString;
      end else
      if FieldName='WAGE_GSND' then
      begin
        WAGEGSND :=Field.AsInteger;
      end else
      if FieldName='WAGE_GSQJ' then
      begin
        WAGEGSQJ :=Field.AsInteger;
      end else
      if FieldName='GSND_GSQJ' then
      begin
        GSNDGSQJ :=Field.AsInteger;
      end else
      if FieldName='KJND_KJQJ' then
      begin
        KJNDKJQJ :=Field.AsInteger;
      end else
      if FieldName='HOLD_TYPE' then
      begin
        HOLDTYPE :=Field.AsInteger;
      end else
      if FieldName='IS_DEALED' then
      begin
        ISDEALED :=Field.AsInteger;
      end else
      if FieldName='HOLD_FROM' then
      begin
        HOLDFROM :=Field.AsInteger;
      end else
      if FieldName='IS_HOLDED' then
      begin
        ISHOLDED :=Field.AsInteger;
      end else
      if FieldName='FIELD1' then
      begin
        FIELD1   :=Field.AsString;
      end else
      if FieldName='FIELD2' then
      begin
        FIELD2   :=Field.AsString;
      end else
      if FieldName='FIELD3' then
      begin
        FIELD3   :=Field.AsString;
      end else
      if FieldName='FIELD4' then
      begin
        FIELD4   :=Field.AsString;
      end else
      if FieldName='FIELD5' then
      begin
        FIELD5   :=Field.AsString;
      end else
      if FieldName='FIELD6' then
      begin
        FIELD6   :=Field.AsString;
      end else
      if FieldName='FIELD7' then
      begin
        FIELD7   :=Field.AsString;
      end else
      if FieldName='FIELD8' then
      begin
        FIELD8   :=Field.AsString;
      end else
      if FieldName='FIELD9' then
      begin
        FIELD9   :=Field.AsString;
      end else
      if FieldName='FIELD10' then
      begin
        FIELD10  :=Field.AsString;
      end else
      if FieldName='FIELD11' then
      begin
        FIELD11  :=Field.AsString;
      end else
      if FieldName='FIELD12' then
      begin
        FIELD12  :=Field.AsString;
      end else
      if FieldName='FIELD13' then
      begin
        FIELD13  :=Field.AsString;
      end else
      if FieldName='FIELD14' then
      begin
        FIELD14  :=Field.AsString;
      end else
      if FieldName='FIELD15' then
      begin
        FIELD15  :=Field.AsString;
      end else
      if FieldName='FIELD16' then
      begin
        FIELD16  :=Field.AsString;
      end else
      if FieldName='FIELD17' then
      begin
        FIELD17  :=Field.AsString;
      end else
      if FieldName='FIELD18' then
      begin
        FIELD18  :=Field.AsString;
      end else
      if FieldName='FIELD19' then
      begin
        FIELD19  :=Field.AsString;
      end else
      if FieldName='FIELD20' then
      begin
        FIELD20  :=Field.AsString;
      end else
      if FieldName='FIELD21' then
      begin
        FIELD21  :=Field.AsString;
      end else
      if FieldName='MEMO1' then
      begin
        MEMO1    :=Field.AsString;
      end else
      if FieldName='FIELD22' then
      begin
        FIELD22  :=Field.AsString;
      end else
      if FieldName='FIELD23' then
      begin
        FIELD23  :=Field.AsString;
      end else
      if FieldName='FIELD24' then
      begin
        FIELD24  :=Field.AsString;
      end else
      if FieldName='FIELD25' then
      begin
        FIELD25  :=Field.AsString;
      end else
      if FieldName='FIELD26' then
      begin
        FIELD26  :=Field.AsString;
      end else
      if FieldName='FIELD27' then
      begin
        FIELD27  :=Field.AsString;
      end else
      if FieldName='FIELD28' then
      begin
        FIELD28  :=Field.AsString;
      end else
      if FieldName='FIELD29' then
      begin
        FIELD29  :=Field.AsString;
      end else
      if FieldName='FIELD30' then
      begin
        FIELD30  :=Field.AsString;
      end else
      if FieldName='FIELD31' then
      begin
        FIELD31  :=Field.AsString;
      end else
      if FieldName='UNIT_FROM' then
      begin
        UNITFROM :=Field.AsString;
      end;
    end
  end;
end;

class function  TWAGEFLOLD.CopyIt(AWAGEFL: TWAGEFLOLD): TWAGEFLOLD;
begin
  Result:=TWAGEFLOLD.Create;
  TWAGEFLOLD.CopyIt(AWAGEFL,Result)
end;

class procedure TWAGEFLOLD.CopyIt(AWAGEFL:TWAGEFLOLD;var Result:TWAGEFLOLD);
begin
  if Result=nil then Exit;
  Result.UNITLINK :=AWAGEFL.UNITLINK;
  Result.GZJGIDEX :=AWAGEFL.GZJGIDEX;
  Result.WAGEKJND :=AWAGEFL.WAGEKJND;
  Result.WAGEKJQJ :=AWAGEFL.WAGEKJQJ;
  Result.WAGEIDEX :=AWAGEFL.WAGEIDEX;
  Result.STAFIDEX :=AWAGEFL.STAFIDEX;
  Result.STAFBDID :=AWAGEFL.STAFBDID;
  Result.STAFTYPE :=AWAGEFL.STAFTYPE;
  Result.STAFBANK :=AWAGEFL.STAFBANK;
  Result.STAFNUMB :=AWAGEFL.STAFNUMB;
  Result.WAGEGSND :=AWAGEFL.WAGEGSND;
  Result.WAGEGSQJ :=AWAGEFL.WAGEGSQJ;
  Result.GSNDGSQJ :=AWAGEFL.GSNDGSQJ;
  Result.KJNDKJQJ :=AWAGEFL.KJNDKJQJ;
  Result.HOLDTYPE :=AWAGEFL.HOLDTYPE;
  Result.ISDEALED :=AWAGEFL.ISDEALED;
  Result.HOLDFROM :=AWAGEFL.HOLDFROM;
  Result.ISHOLDED :=AWAGEFL.ISHOLDED;
  Result.FIELD1   :=AWAGEFL.FIELD1;
  Result.FIELD2   :=AWAGEFL.FIELD2;
  Result.FIELD3   :=AWAGEFL.FIELD3;
  Result.FIELD4   :=AWAGEFL.FIELD4;
  Result.FIELD5   :=AWAGEFL.FIELD5;
  Result.FIELD6   :=AWAGEFL.FIELD6;
  Result.FIELD7   :=AWAGEFL.FIELD7;
  Result.FIELD8   :=AWAGEFL.FIELD8;
  Result.FIELD9   :=AWAGEFL.FIELD9;
  Result.FIELD10  :=AWAGEFL.FIELD10;
  Result.FIELD11  :=AWAGEFL.FIELD11;
  Result.FIELD12  :=AWAGEFL.FIELD12;
  Result.FIELD13  :=AWAGEFL.FIELD13;
  Result.FIELD14  :=AWAGEFL.FIELD14;
  Result.FIELD15  :=AWAGEFL.FIELD15;
  Result.FIELD16  :=AWAGEFL.FIELD16;
  Result.FIELD17  :=AWAGEFL.FIELD17;
  Result.FIELD18  :=AWAGEFL.FIELD18;
  Result.FIELD19  :=AWAGEFL.FIELD19;
  Result.FIELD20  :=AWAGEFL.FIELD20;
  Result.FIELD21  :=AWAGEFL.FIELD21;
  Result.MEMO1    :=AWAGEFL.MEMO1;
  Result.FIELD22  :=AWAGEFL.FIELD22;
  Result.FIELD23  :=AWAGEFL.FIELD23;
  Result.FIELD24  :=AWAGEFL.FIELD24;
  Result.FIELD25  :=AWAGEFL.FIELD25;
  Result.FIELD26  :=AWAGEFL.FIELD26;
  Result.FIELD27  :=AWAGEFL.FIELD27;
  Result.FIELD28  :=AWAGEFL.FIELD28;
  Result.FIELD29  :=AWAGEFL.FIELD29;
  Result.FIELD30  :=AWAGEFL.FIELD30;
  Result.FIELD31  :=AWAGEFL.FIELD31;
  Result.UNITFROM :=AWAGEFL.UNITFROM;
end;

end.

